﻿using System;

using System.Collections.Generic;
using System.Text;
using Silvermoon.OpenGL;
using System.Drawing;

namespace Silvermoon.Shapes
{
    public class BackgroundShape : ColorShape
    {
        private RenderStyle style = RenderStyle.Plastic;
        private Texture texture;

        protected override Texture TextureCore { get { return texture; } }
        protected override RenderStyle StyleCore { get { return style; } }



        /// <summary>
        /// Gets or sets the style how to render the background.
        /// </summary>
        public RenderStyle Style { get { return style; } set { if (style != value) { style = value; Invalidate(); } } }

        /// <summary>
        /// Gets or sets the texture that contains the 4 quadrants to render.
        /// </summary>
        public Texture Texture { get { return texture; } set { if (texture != value) { texture = value; Invalidate(); } } }


        public bool Signed { get { return texture != null ? texture.IsSigned : false; } }

        protected override Shape CreateClone()
        {
            return new BackgroundShape();
        }

        protected override void Copy(Shape shape)
        {
            base.Copy(shape);
            BackgroundShape s = shape as BackgroundShape;
            s.Style = Style;
            s.Texture = Texture;
        }

    }
}
